<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加房间收费设置</title>
<%@ include file="/WEB-INF/sys/include/css.jsp"%>
</head>
<body>
<form id="form" action="${path}/roomFee/update.json" method="post">
<div class="form">
	<div class="group">
		<div class="label">*房间编号:</div>
		<div class="text">${roomFee.roomCode }</div>
	</div>
	<div class="group">
		<div class="label">*项目名称:</div>
		<div class="item">
			<input type="text" id="prjname" name="prjname" />
			<input type="hidden" name="itemid" id="itemid" value="${roomFee.itemid }" />
		</div>
		<div class="item" id="prjnameTip"></div>
	</div>
	<div class="group">
		<div class="label">*项目代码:</div>
		<div class="item"><input type="text" name="prjcode" id="prjcode" value="${roomFee.prjcode }" /></div>
	</div>
	<div class="group">
		<div class="label">*项目名称:</div>
		<div class="item"><input type="text" name="prjname" id="prjname" value="${roomFee.prjname }" /></div>
	</div>
	<div class="group">
		<div class="label">计费单价:</div>
		<div class="item"><input type="text" name="price" id="price" value="${roomFee.price }" /></div>
	</div>
	<div class="group">
		<div class="label">是否收费:</div>
		<div class="item">
			<input type="radio" id="isfee0" name="isfee" value="0" ${roomFee.isfee==0?'checked="checked"':'' } /><label for="isfee0" class="label">否</label>
			<input type="radio" id="isfee1" name="isfee" value="1" ${roomFee.isfee==1?'checked="checked"':'' } /><label for="isfee1" class="label">是</label>
		</div>
	</div>
	<div class="group">
		<div class="label">*计费周期:</div>
		<div class="item"><input type="text" name="cycle" id="cycle" value="${roomFee.cycle }" /></div>
	</div>
	<div class="group">
		<div class="label">*计费周期单位:</div>
		<div class="item"><input type="text" name="cycleUnit" id="cycleUnit" value="${roomFee.cycleUnit }" /></div>
	</div>
	<div class="group">
		<div class="label">*计费周期数:</div>
		<div class="item"><input type="text" name="cycleNum" id="cycleNum" value="${roomFee.cycleNum }" /></div>
	</div>
	<div class="group">
		<div class="label">*计费开始日期:</div>
		<div class="item"><input type="text" name="beginTime" id="beginTime" ltype="date" value="<fmt:formatDate value="${roomFee.beginTime }" pattern="yyyy-MM-dd" />" /></div>
	</div>
	<div class="group">
		<div class="label">*计费结束日期:</div>
		<div class="item"><input type="text" name="endTime" id="endTime" ltype="date" value="<fmt:formatDate value="${roomFee.endTime }" pattern="yyyy-MM-dd" />" /></div>
	</div>
	<div class="group">
		<div class="label">计费精度:</div>
		<div class="item">
			<input type="radio" id="accuracy0" name="accuracy" value="0" ${roomFee.accuracy==0?'checked="checked"':'' } /><label for="accuracy0" class="label">元</label>
			<input type="radio" id="accuracy1" name="accuracy" value="1" ${roomFee.accuracy==1?'checked="checked"':'' } /><label for="accuracy1" class="label">角</label>
			<input type="radio" id="accuracy2" name="accuracy" value="2" ${roomFee.accuracy==2?'checked="checked"':'' } /><label for="accuracy2" class="label">分</label>
		</div>
	</div>
	<div class="group">
		<div class="label">打印次序:</div>
		<div class="item"><input type="text" name="printIndex" id="printIndex" value="${roomFee.printIndex }" /></div>
	</div>
	<div class="group">
		<div class="label">计费面积:</div>
		<div class="item"><input type="text" name="feeArea" id="feeArea" value="${roomFee.feeArea }" /></div>
	</div>
	<div class="group">
		<div class="label">备注:</div>
		<div class="item"><input type="text" name="remark" id="remark" value="${roomFee.remark }" /></div>
	</div>
	<div class="group">
		<div class="label">滞纳金率:</div>
		<div class="item"><input type="text" name="latePaymentsRate" id="latePaymentsRate" value="${roomFee.latePaymentsRate }" /></div>
	</div>
	<div class="group">
		<div class="label">滞纳金开始天数:</div>
		<div class="item"><input type="text" name="latePaymentsDays" id="latePaymentsDays" value="${roomFee.latePaymentsDays }" /></div>
	</div>
	<div class="group">
		<div class="label">递增月份数:</div>
		<div class="item"><input type="text" name="incrementMonths" id="incrementMonths" value="${roomFee.incrementMonths }" /></div>
	</div>
	<div class="group">
		<div class="label">递增百分比:</div>
		<div class="item"><input type="text" name="incrementPercent" id="incrementPercent" value="${roomFee.incrementPercent }" /></div>
	</div>
	<div class="group">
		<div class="label">是否阶梯:</div>
		<div class="item">
			<input type="radio" id="tiered0" name="tiered" value="0" ${roomFee.tiered==0?'checked="checked"':'' } /><label for="tiered0" class="label">否</label>
			<input type="radio" id="tiered1" name="tiered" value="1" ${roomFee.tiered==1?'checked="checked"':'' } /><label for="tiered1" class="label">是</label>
		</div>
	</div>
	<div class="group">
		<div class="label">收费方式:</div>
		<div class="item">
			<input type="radio" id="feeMode0" name="feeMode" value="0" ${roomFee.feeMode==0?'checked="checked"':'' } /><label for="feeMode0" class="label">周期性</label>
			<input type="radio" id="feeMode1" name="feeMode" value="1" ${roomFee.feeMode==1?'checked="checked"':'' } /><label for="feeMode1" class="label">临时性</label>
		</div>
	</div>
	<div class="group">
		<div class="label">计费方式:</div>
		<div class="item">
			<input type="radio" id="chargeMode0" name="chargeMode" value="0" ${roomFee.chargeMode==0?'checked="checked"':'' } /><label for="chargeMode0" class="label">建面</label>
			<input type="radio" id="chargeMode1" name="chargeMode" value="1" ${roomFee.chargeMode==1?'checked="checked"':'' } /><label for="chargeMode1" class="label">定额</label>
			<input type="radio" id="chargeMode2" name="chargeMode" value="2" ${roomFee.chargeMode==2?'checked="checked"':'' } /><label for="chargeMode2" class="label">公式</label>
			<input type="radio" id="chargeMode3" name="chargeMode" value="3" ${roomFee.chargeMode==3?'checked="checked"':'' } /><label for="chargeMode3" class="label">抄表</label>
		</div>
	</div>
	<div class="group">
		<div class="label">收费类型:</div>
		<div class="item">
			<input type="radio" id="feeType0" name="feeType" value="0" ${roomFee.feeType==0?'checked="checked"':'' } /><label for="feeType0" class="label">普通</label>
			<input type="radio" id="feeType1" name="feeType" value="1" ${roomFee.feeType==1?'checked="checked"':'' } /><label for="feeType1" class="label">押金</label>
			<input type="radio" id="feeType2" name="feeType" value="2" ${roomFee.feeType==2?'checked="checked"':'' } /><label for="feeType2" class="label">预收款</label>
		</div>
	</div>
	<div class="group">
		<div class="label">车牌编号:</div>
		<div class="item"><input type="text" name="carCode" id="carCode" value="${roomFee.carCode }" /></div>
	</div>
	<div class="group">
		<div class="label">是否车位费项目:</div>
		<div class="item">
			<input type="radio" id="iscarport0" name="iscarport" value="0" ${roomFee.iscarport==0?'checked="checked"':'' } /><label for="iscarport0" class="label">否</label>
			<input type="radio" id="iscarport1" name="iscarport" value="1" ${roomFee.iscarport==1?'checked="checked"':'' } /><label for="iscarport1" class="label">是</label>
		</div>
	</div>
	<div class="group">
		<div class="label">*缴费截止日期:</div>
		<div class="item"><input type="text" name="feeEndTime" id="feeEndTime" ltype="date" value="<fmt:formatDate value="${roomFee.feeEndTime }" pattern="yyyy-MM-dd" />" /></div>
	</div>
	<div class="group">
		<div class="label">最近收费流水号:</div>
		<div class="item"><input type="text" name="latestSerial" id="latestSerial" value="${roomFee.latestSerial }" /></div>
	</div>
	
	<div class="group">
		<div class="label">计算公式:</div>
		<div class="item"><input type="text" name="formulas" id="formulas" value="${roomFee.formulas }" /></div>
	</div>
	
	<div class="buttons">
		<button class="highlight" id="submit1" type="button">确定</button>
		<button type="button" id="cancel1">取消</button>
		<input type="hidden" id="feeid" name="feeid" value="${roomFee.feeid }" />
	</div>
</div>
</form>
<%@ include file="/WEB-INF/sys/include/script.jsp" %>
<script type="text/javascript">
var itemid = '${roomFee.itemid }';
$(function() {
	createSelect("prjname", "itemid", {
		textField: 'prjname', valueField:'itemid',
		url:'${path}/feeItem/getFeeItemData.json?companyid=${companyid}',
		onSelected: function(id, name, data){
			if(!itemid && !!id){
				$.get('${path}/feeItem/getFeeItem.json?itemid='+id, function(data){
					if(!data)return;
					$("#prjcode").val(data.prjcode);
					$("#price").val(data.price);
					$("#feeMode"+data.feeMode).prop("checked", true);
					$("#chargeMode"+data.chargeMode).prop("checked", true);
					$("#feeType"+data.feeType).prop("checked", true);
					$("#cycle").val(data.cycle);
					$("#cycleNum").val(data.cycleNum);
					$("#cycleUnit").val(data.cycleUnit);
					$("#isfee"+data.isfee).prop("checked", true);
					$("#accuracy"+data.accuracy).prop("checked", true);
					$("#printIndex").val(data.printIndex);
					$("#tiered"+data.tiered).prop("checked", true);
					$("#latePaymentsRate").val(data.latePaymentsRate);
					$("#latePaymentsDays").val(data.latePaymentsDays);
					$("#incrementMonths").val(data.incrementMonths);
					$("#incrementPercent").val(data.incrementPercent);
					$("#formulas").val(data.formulas);
					
				});
				itemid = null;
			}
			
		}
	});
	$("#form").ligerForm({inputWidth: 300});
	
	verifyForm("form", {}, function(){
		$("#form").ajaxForm(function(data){
			UiUtil.isSuccess(data, "添加房间收费设置成功", function(){
				UiUtil.closeForm(true);
			});
		});
	});
	
	$("#submit1").click(function(){
		UiUtil.lockButton('submit1');
		$("#form").submit();
	});

	$("#cancel1").click(function(){
		UiUtil.closeForm();
	});
	
});
</script>
</body>
</html>